home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr05 / ddl110.zip / MSADDL11.TXT < prev    next >
Text File  |  1993-06-17  |  49KB  |  937 lines

  1. ****************************************************************************
  2. ----------------------------------------------------------------------------
  3. |                         IMPORTANT - PLEASE READ                          
  4. ----------------------------------------------------------------------------
  5. |
  6. | You have a royalty-free right to use, modify, reproduce and distribute 
  7. | the software found in these sample files provided, however, that: (a)   
  8. | you agree that the MS software is PROVIDED "AS IS" WITHOUT
  9. | WARRANTY OF ANY KIND and in no event shall MS be liable for 
  10. | any damages whatsoever in connection with your use of the software; 
  11. | and (b) the utilities are redististributed solely in conjunction with and 
  12. | as part of your software application.
  13. |                                                                          
  14. | Copyright 1993 Microsoft Corporation. All Rights Reserved.               
  15. | Microsoft and MS-DOS are registered trademarks and Microsoft Access and  
  16. | Windows are trademarks of Microsoft Corporation.                         
  17. ****************************************************************************
  18.  
  19. OVERVIEW
  20. --------
  21.    The Microsoft Access Data Definition Language Dynamic Link Library
  22.    (MSADDL11.DLL) provides data definition support beyond that provided by
  23.    standard Microsoft Access.
  24.  
  25. GOALS
  26. -----
  27.    To enable the Access Basic programmer to create and alter tables, fields, 
  28.    indexes, and relationships, and then use those tables in Microsoft Access
  29.    and Access Basic.
  30.  
  31. CAUTIONS
  32. --------
  33.    This Utility is provided specifically as an aid to developers who need
  34.    additional data definition information not provided in the Microsoft
  35.    Access retail documentation. As with any DLL, passing an incorrect
  36.    argument type or value could result in General Protection Fault (GPF)
  37.    errors. If this happens, carefully check your arguments. This Utility
  38.    includes an include file (MSA_DDL.TXT) that you can use to declare these
  39.    functions. This Utility is not supported by Microsoft; as such, you
  40.    should save your work-in-progress frequently to avoid loss of data. 
  41. ****************************************************************************
  42.  
  43. DESCRIPTION OF THE DATA DEFINITION DDL
  44. --------------------------------------
  45.    The Data Definition interface is a Dynamic Link Library (DLL) you can
  46.    call from Access Basic. Its purpose is to allow Access Basic programmers 
  47.    to programatically manipulate table definitions and data relationships.
  48.    For example, this DLL lets you create tables via Access Basic code.
  49.  
  50.    (Note: You can use these functions only with Microsoft Access databases
  51.           and tables, and not with any other databases or tables.)
  52.  
  53.    Table 1 lists the functions provided by MSADDL11.DLL. Each function is
  54.    fully described later in this document.
  55.  
  56.       Table 1.  MSADDL11.DLL Functions
  57.       ----------------------------------------------------------------------
  58.       Function Name             Purpose
  59.       ------------------------- --------------------------------------------
  60.       AccessDDLStartEngine      Initializes Microsoft Access database engine
  61.       AccessDDLStopEngine       Stops the database engine
  62.  
  63.       AccessDDLOpenDatabase     Opens a specified Microsoft Access database
  64.       AccessDDLCloseDatabase    Closes the database
  65.  
  66.       AccessDDLOpenTable        Opens an existing table
  67.       AccessDDLCloseTable       Closes an open table
  68.       AccessDDLCreateTable      Creates a new table
  69.       AccessDDLDeleteTable      Deletes an existing table
  70.       AccessDDLRenameTable      Renames an existing table
  71.  
  72.       AccessDDLAddField         Adds a new field to a table
  73.       AccessDDLDeleteField      Deletes an existing field
  74.       AccessDDLRenameField      Renames an existing field
  75.  
  76.       AccessDDLCreateIndex      Creates a new index in an existing table
  77.       AccessDDLDeleteIndex      Deletes an existing index
  78.       AccessDDLRenameIndex      Renames an existing index
  79.  
  80.       AccessDDLCreateReference  Creates a new relationship between tables
  81.       AccessDDLDeleteReference  Deletes an existing relationship
  82.  
  83. ****************************************************************************
  84.  
  85. GENERAL DDL PROCEDURE
  86. ---------------------
  87.    Before you can create, alter, or delete a table, field, index, or
  88.    relationship, you must first use the AccessDDLStartEngine function to
  89.    initialize the Microsoft Access ISAM database engine. When you are
  90.    finished with all DDL operations, use the AccessDDLStopEngine function.
  91.    The following figure illustrates this general procedure.
  92.  
  93.       Figure 1.  General DDL Procedure
  94.       ----------------------------------------------------------------------
  95.       
  96.       AccessDDLStartEngine
  97.       AccessDDLOpenDatabase
  98.  
  99.         AccessDDLOpenTable
  100.         ' Perform field, index, and relationship operations.
  101.         AccessDDLCloseTable
  102.  
  103.         AccessDDLCreateTable
  104.         ' Perform field, index, and relationship operations.
  105.         AccessDDLCloseTable
  106.  
  107.       AccessDDLCloseDatabase
  108.       AccessDDLStopEngine
  109.  
  110. ****************************************************************************
  111.  
  112. OTHER CONSIDERATIONS
  113. --------------------
  114.    The various functions in MSADDL11.DLL don't let you set all of the
  115.    properties normally available in MS Access table design (such as
  116.    Description and Validation Rule). To set or change these properties, you
  117.    must use the regular table design feature of Microsoft Access.
  118.  
  119. ****************************************************************************
  120.  
  121. FUNCTION DESCRIPTIONS
  122. ---------------------
  123. AccessDDLStartEngine Function
  124.  
  125.       Description  Performs the initialization required to use the Microsoft
  126.                    Access ISAM database engine.
  127.  
  128.       Syntax       AccessDDLStartEngine(SysDBName, INIFileName, UserName,
  129.                       Password)
  130.  
  131.       Remarks      The AccessDDLStartEngine function uses the following
  132.                    arguments.
  133.  
  134.                    Argument       Description
  135.                    -------------- ------------------------------------------
  136.                    SysDBName      String that identifies the path and name
  137.                                   of the system database file; must be a
  138.                                   valid operating system path; this argument 
  139.                                   is ignored when AccessDDLStartEngine is
  140.                                   called from Access Basic, since the path
  141.                                   and name have already been established.
  142.                    INIFileName    String that identifies the path and name
  143.                                   of the INI file; length may not exceed 14
  144.                                   characters; this argument is ignored when
  145.                                   AccessDDLStartEngine is called from Access
  146.                                   Basic, since the path and name have
  147.                                   already been established.
  148.                    UserName       String that is that name of the current
  149.                                   user.
  150.                    Password       String that is the current user's
  151.                                   password.
  152.       
  153.       Returns
  154.       ----------------------------------------------------------------------
  155.       ACCESSDDL_ErrSuccess             Operation was successful.
  156.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  157.                                        permissions.
  158.       ACCESSDDL_ErrAlreadyInitialized  AccessDDLStartEngine already called.
  159.       ACCESSDDL_ErrInvalidAccountName  Couldn't find account name.
  160.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  161.                                        Null.
  162.       ACCESSDDL_ErrInvalidPassword     Incorrect or invalid password.
  163.       ACCESSDDL_ErrPermissionDenied    Invalid DatabaseID argument.
  164.       ACCESSDDL_ErrTooManyTasks        Too many concurrent DDL instances.
  165.  
  166. AccessDDLStopEngine Function
  167.  
  168.       Description  Stops the Microsoft Access ISAM database engine and
  169.                    closes the current session.
  170.  
  171.       Syntax       AccessDDLStopEngine()
  172.  
  173.       Remarks      The AccessDDLStopEngine function accepts no arguments.
  174.  
  175.       Returns
  176.       ----------------------------------------------------------------------
  177.       ACCESSDDL_ErrSuccess             Operation was successful.
  178.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  179.                                        called.
  180.  
  181. AccessDDLOpenDatabase Function
  182.  
  183.       Description  Opens an existing Microsoft Access database to allow
  184.                    subsequent DDL operations.
  185.  
  186.       Syntax       AccessDDLOpenDatabase(DatabaseName, DatabaseID)
  187.  
  188.       Remarks      The AccessDDLOpenDatabase function uses the following
  189.                    arguments.
  190.  
  191.                    Argument       Description
  192.                    -------------- ------------------------------------------
  193.                    DatabaseName   String that is name of the database,
  194.                                   including the path.
  195.                    DatabaseID     Long integer returned by the function that
  196.                                   identifies the database.
  197.  
  198.       Returns
  199.       ----------------------------------------------------------------------
  200.       ACCESSDDL_ErrSuccess             Operation was successful.
  201.       ACCESSDDL_ErrDatabaseInvalidName Invalid database name.
  202.       ACCESSDDL_ErrDatabaseNotFound    Couldn't find specified database.
  203.       ACCESSDDL_ErrFileAccessDenied    Couldn't open the specified database.
  204.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  205.                                        Null.
  206.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  207.                                        called.
  208.       ACCESSDDL_ErrPermissionDenied    Database file is read-only.
  209.       ACCESSDDL_ErrTooManyOpenFiles    No MS-DOS file handle available.
  210.  
  211.       This function may also return various error codes associated with
  212.       resource failure.
  213.  
  214. AccessDDLCloseDatabase Function
  215.  
  216.       Description  Closes a database previously opened with the
  217.                    AccessDDLOpenDatabase function.
  218.  
  219.       Syntax       AccessDDLCloseDatabase(DatabaseID)
  220.  
  221.       Remarks      The AccessDDLCloseDatabase function uses the following
  222.                    arguments.
  223.  
  224.                    Argument       Description
  225.                    -------------- ------------------------------------------
  226.                    DatabaseID     Long integer that is the ID of the
  227.                                   database to be closed.
  228.  
  229.       Returns
  230.       ----------------------------------------------------------------------
  231.       ACCESSDDL_ErrSuccess             Operation was successful.
  232.       ACCESSDDL_ErrDatabaseCloseError  Couldn't close database file.
  233.       ACCESSDDL_ErrDatabaseNotFound    Couldn't find database or database
  234.                                        not open.
  235.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  236.                                        called.
  237.  
  238.       This function may also return various error codes associated with
  239.       resource failure.
  240.  
  241. AccessDDLOpenTable Function
  242.  
  243.       Description  Opens an existing Microsoft Access table to allow
  244.                    subsequent DDL operations.
  245.  
  246.       Syntax       AccessDDLOpenTable(DatabaseID, TableName, TableID);
  247.  
  248.       Remarks      The AccessDDLOpenTable function uses the following
  249.                    arguments.
  250.  
  251.                    Argument       Description
  252.                    -------------- ------------------------------------------
  253.                    DatabaseID     Long integer that identifies the database
  254.                                   that contains the table to be opened.
  255.                    TableName      String that is the name of the table to be
  256.                                   opened.
  257.                    TableID        Long integer returned by the function that
  258.                                   identifies the opened table.
  259.  
  260.                    AccessDDLOpenTable opens the specified table exclusively.
  261.                    When you are finished with all DDL operations on the
  262.                    table, use the AccessDDLCloseTable function to close the
  263.                    table.
  264.  
  265.       Returns
  266.       ----------------------------------------------------------------------
  267.       ACCESSDDL_ErrSuccess             Operation was successful.
  268.       ACCESSDDL_ErrFileAccessDenied    Current user doesn't have required
  269.                                        permissions.
  270.       ACCESSDDL_ErrInvalidDatabaseID   No such database or database not
  271.                                        open.
  272.       ACCESSDDL_ErrInvalidName         Invalid table name.
  273.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  274.                                        Null.
  275.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  276.                                        called.
  277.       ACCESSDDL_ErrObjectNotFound      Couldn't find specified table.
  278.       ACCESSDDL_ErrTableInUse          Couldn't open table exclusively.
  279.       
  280.       This function may also return various error codes associated with
  281.       resource failure.
  282.  
  283. AccessDDLCloseTable Function
  284.  
  285.       Description  Closes a table previously opened with the
  286.                    AccessDDLOpenTable or AccessDDLCreateTable functions.
  287.  
  288.       Syntax       AccessDDLCloseTable(TableID)
  289.  
  290.       Remarks      The AccessDDLCloseTable function uses the following
  291.                    arguments.
  292.  
  293.                    Argument       Description
  294.                    -------------- ------------------------------------------
  295.                    TableID        Long integer that identifies the table to
  296.                                   be closed; this is the value returned by
  297.                                   AccessDDLOpenTable when the table was
  298.                                   opened.
  299.  
  300.                    Once closed, the table's TableID will be invalid.
  301.       
  302.       Returns
  303.       ----------------------------------------------------------------------
  304.       ACCESSDDL_ErrSuccess             Operation was successful.
  305.       ACCESSDDL_ErrInvalidTableID      Invalid TableID.
  306.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  307.                                        called.
  308.  
  309. AccessDDLCreateTable Function
  310.  
  311.       Description  Creates a new table in the specified database.
  312.  
  313.       Syntax       AccessDDLCreateTable(DatabaseID, TableName, TableID)
  314.  
  315.       Remarks      The AccessDDLCreateTable function uses the following
  316.                    arguments.
  317.  
  318.                    Argument       Description
  319.                    -------------- ------------------------------------------
  320.                    DatabaseID     Long integer that identifies the database
  321.                                   in which the new table will be created.
  322.                    TableName      String that is the name of the table to be
  323.                                   created; may not exceed 64 characters.
  324.                    TableID        Long integer returned by the function that
  325.                                   identifies the exclusively opened table.
  326.  
  327.                    The new table will be opened exclusively.
  328.                    
  329.                    The table will have no fields and no indexes. Use the
  330.                    AccessDDLAddField function to add fields and
  331.                    AccessDDLCreateIndex to add indexes. It is inadvisable
  332.                    to create a table without also defining fields for that
  333.                    table.
  334.  
  335.                    You must use the AccessDDLCloseTable function
  336.                    to close the table when you are finished with it.
  337.  
  338.       Returns
  339.       ----------------------------------------------------------------------
  340.       ACCESSDDL_ErrSuccess             Operation was successful.
  341.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  342.                                        permissions.
  343.       ACCESSDDL_ErrInvalidDatabaseID   Invalid DatabaseID argument.
  344.       ACCESSDDL_ErrInvalidName         Invalid table name.
  345.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  346.                                        Null.
  347.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  348.                                        called.
  349.       ACCESSDDL_ErrTableDuplicate      Table already exists.
  350.       
  351.       This function may also return various error codes associated with
  352.       resource failure.
  353.  
  354. AccessDDLDeleteTable Function
  355.  
  356.       Description  Deletes a specified table, its data, and any indexes.
  357.  
  358.       Syntax       AccessDDLDeleteTable(DatabaseID, TableName)
  359.  
  360.       Remarks      The AccessDDLDeleteTable function uses the following
  361.                    arguments.
  362.  
  363.                    Argument       Description
  364.                    -------------- ------------------------------------------
  365.                    DatabaseID     Long integer that identifies the database
  366.                                   that contains the table.
  367.                    TableName      String that is the name of the table to be
  368.                                   deleted; may not exceed 64 characters.
  369.  
  370.                    The table must not be open by any user, including the
  371.                    current user.
  372.  
  373.                    The current user must have Modify Definitions permission
  374.                    for the specified table.
  375.  
  376.                    Once deleted, all queries, forms, reports, or code that
  377.                    reference the table will be invalid.
  378.  
  379.       IMPORTANT    When you use AccessDDLDeleteTable to delete a table that
  380.                    was created or modified in MS Access table design (as
  381.                    opposed to created or modified using MSADDL11.DLL), MS
  382.                    Access maintains internal information about the table
  383.                    which will remain in the database until the database is
  384.                    compacted. Until this information is discarded, you will
  385.                    encounter unpredictable results if you use the
  386.                    AccessDDLCreateTable function to create another table
  387.                    with the same name, or use the AccessDDLRenameTable
  388.                    function to rename an existing table to the same name
  389.                    without first compacting the database.
  390.  
  391.       Returns
  392.       ----------------------------------------------------------------------
  393.       ACCESSDDL_ErrSuccess             Operation was successful.
  394.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  395.                                        permissions.
  396.       ACCESSDDL_ErrIndexInUse          Table contains an index that exists
  397.                                        in a reference (relationship) and
  398.                                        can't be deleted.
  399.       ACCESSDDL_ErrInvalidDatabaseID   Invalid DatabaseID argument.
  400.       ACCESSDDL_ErrInvalidName         Invalid table name.
  401.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  402.                                        Null.
  403.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  404.                                        called.
  405.       ACCESSDDL_ErrObjectNotFound      No such table.
  406.       ACCESSDDL_ErrTableInUse          Table is in use by another user.
  407.  
  408. AccessDDLRenameTable Function
  409.  
  410.       Description  Renames a specified table.
  411.  
  412.       Syntax       AccessDDLRenameTable(DatabaseID, OldTableName,
  413.                      NewTableName)
  414.  
  415.       Remarks      The AccessDDLRenameTable function uses the following
  416.                    arguments.
  417.  
  418.                    Argument       Description
  419.                    -------------- ------------------------------------------
  420.                    DatabaseID     Long integer that identifies the database
  421.                                   that contains the table.
  422.                    OldTableName   String that is the table to be renamed;
  423.                                   may not exceed 64 characters.
  424.                    NewTableName   String that is the new table name; may not
  425.                                   exceed 64 characters.
  426.  
  427.                    You can freely rename tables created with MSADDL11.DLL;
  428.                    however, when you rename a table that was created in MS
  429.                    Access table design (as opposed to created using the DLL),
  430.                    Access will maintain outdated internal information about the
  431.                    old table name which will remain in the database until the
  432.                    database is compacted. Until this information is discarded,
  433.                    you will encounter unpredictable results if you use the
  434.                    AccessDDLCreateTable or AccessDDLRenameTable functions to
  435.                    create or rename another table with the old table name.
  436.                    Also note that any properties defined in table design will 
  437.                    be lost if the table is renamed using AcccessDDLRenameTable.
  438.  
  439.                    The table must be closed in order to be renamed.
  440.  
  441.                    Once renamed, all queries, forms, reports, or code that
  442.                    reference the old table name will be invalid.
  443.  
  444.                    The current user must have Modify Definitions permission
  445.                    for the table.
  446.  
  447.       Returns
  448.       ----------------------------------------------------------------------
  449.       ACCESSDDL_ErrSuccess             Operation was successful.
  450.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  451.                                        permissions.
  452.       ACCESSDDL_ErrInvalidDatabaseID   Invalid DatabaseID argument.
  453.       ACCESSDDL_ErrInvalidName         Invalid table name.
  454.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  455.                                        Null.
  456.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  457.                                        called.
  458.       ACCESSDDL_ErrObjectNotFound      Couldn't find specified table.
  459.       ACCESSDDL_ErrTableDuplicate      New table name already exists.
  460.       ACCESSDDL_ErrTableInUse          Table is in use by another user.
  461.  
  462. AccessDDLAddField Function
  463.  
  464.       Description  Adds a new field to a specified table.  
  465.  
  466.       Syntax       AccessDDLAddField(DatabaseID, TableID, FieldName,
  467.                       FieldType, Max, AutoIncr)
  468.  
  469.       Remarks      The AccessDDLAddField function uses the following
  470.                    arguments.
  471.  
  472.                    Argument       Description
  473.                    -------------- ------------------------------------------
  474.                    DatabaseID     Long integer that identifies the database
  475.                                   that contains the table to which the new
  476.                                   field will be added.
  477.                    TableId        Long integer that identifies the table;
  478.                                   this is the value returned by
  479.                                   AccessDDLOpenTable when the table was
  480.                                   opened.
  481.                    FieldName      String that is the name of the new field;
  482.                                   may not exceed 64 characters.
  483.                    FieldType      Integer that identifies the field type;
  484.                                   valid FieldType values are:
  485.  
  486.                                   ACCESSDDL_FIELDTYPEYESNO       yes/no
  487.                                   ACCESSDDL_FIELDTYPEBYTE        byte
  488.                                   ACCESSDDL_FIELDTYPEINTEGER     integer
  489.                                   ACCESSDDL_FIELDTYPELONGINTEGER long integer
  490.                                   ACCESSDDL_FIELDTYPECURRENCY    currency
  491.                                   ACCESSDDL_FIELDTYPESINGLE      single
  492.                                   ACCESSDDL_FIELDTYPEDOUBLE      double
  493.                                   ACCESSDDL_FIELDTYPEDATETIME    date/time
  494.                                   ACCESSDDL_FIELDTYPETEXT        text
  495.                                   ACCESSDDL_FIELDTYPEOLE         OLE object
  496.                                   ACCESSDDL_FIELDTYPEMEMO        memo
  497.                    Max            Long integer that is the maximum length of
  498.                                   a text field.
  499.                    AutoIncr       Integer that specifies whether the
  500.                                   field is an autoincrement field; valid
  501.                                   AutoIncr values are:
  502.  
  503.                                     -1  A unique ascending sequence
  504.                                         number will be automatically
  505.                                         assigned to the field when a new
  506.                                         record is added to the table.
  507.                                         FieldType must be a long integer.
  508.                                      0  No such number will be assigned.
  509.  
  510.                    If FieldType identifies a numeric field type, the field's
  511.                    width will be fixed. All other field types will render a
  512.                    variable-width field.
  513.  
  514.                    The current user must have Modify Definitions permission
  515.                    for the table.
  516.  
  517.                    Tables can each contain up to 256 fields.
  518.  
  519.       Returns
  520.       ----------------------------------------------------------------------
  521.       ACCESSDDL_ErrSuccess             Operation was successful.
  522.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  523.                                        permissions.
  524.       ACCESSDDL_ErrField2ndSysMaint    More than one autoincrement field
  525.                                        has been defined.
  526.       ACCESSDDL_ErrFieldDuplicate      Field definition already exists.
  527.       ACCESSDDL_ErrFieldTooBig         Text field width exceeds 255
  528.                                        characters.
  529.       ACCESSDDL_ErrInvalidFieldType    Invalid FieldType argument.
  530.       ACCESSDDL_ErrInvalidDatabaseID   Invalid DatabaseID argument.
  531.       ACCESSDDL_ErrInvalidName         Invalid FieldName argument.
  532.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  533.                                        Null.
  534.       ACCESSDDL_ErrInvalidTableID      Invalid TableID argument.
  535.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  536.                                        called.
  537.       ACCESSDDL_ErrTooManyFields       More than 256 fields defined.
  538.  
  539. AccessDDLDeleteField Function
  540.  
  541.       Description  Deletes a specified field from a specified
  542.                    table.
  543.  
  544.       Syntax       AccessDDLDeleteField(TableID, FieldName)
  545.  
  546.       Remarks      The AccessDDLDeleteField function uses the following
  547.                    arguments.
  548.  
  549.                    Argument       Description
  550.                    -------------- ------------------------------------------
  551.                    TableID        Long integer that identifies the
  552.                                   exclusively opened table; this is the
  553.                                   value returned by AccessDDLOpenTable when
  554.                                   the table was opened.
  555.                    FieldName      String that is the name of the field to
  556.                                   be deleted; may not exceed 64 characters.
  557.  
  558.                    You can't delete a field if the table contains an index
  559.                    based on that field. To delete the field, you must first
  560.                    use the AccessDDLDeleteIndex function to delete the
  561.                    index.
  562.  
  563.                    You also can't delete a field if there is a relationship 
  564.                    based on that field.  To delete the field, the relationship
  565.                    must first be deleted using AccessDDLDeleteReference.
  566.  
  567.                    The current user must have both Modify Definitions and
  568.                    Read Data permissions for the table. 
  569.  
  570.                    If the field width is fixed (for example, a text field),
  571.                    the space for the field in existing records won't always
  572.                    be recovered. New records will contain space for the
  573.                    deleted field.
  574.  
  575.                    If the field width is variable (for example, a memo
  576.                    field), any data in existing records is not deleted and
  577.                    no space is recovered. New records will contain a single
  578.                    byte for the deleted field.
  579.  
  580.                    To recover the space deleted by AccessDDLDeleteField,
  581.                    compact the database.
  582.  
  583.                    Once deleted, all queries, forms, reports, or code that
  584.                    reference the deleted field will be invalid.
  585.       
  586.       Returns
  587.       ----------------------------------------------------------------------
  588.       ACCESSDDL_ErrSuccess             Operation was successful.
  589.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  590.                                        permissions.
  591.       ACCESSDDL_ErrFieldIndexed        Can't delete field because index
  592.                                        using this field exists.
  593.       ACCESSDDL_ErrFieldNotFound       Couldn't find specified field.
  594.       ACCESSDDL_ErrInvalidName         Invalid field name.
  595.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  596.                                        Null.
  597.       ACCESSDDL_ErrInvalidTableID      Invalid TableID argument.
  598.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  599.                                        called.
  600.  
  601. AccessDDLRenameField Function
  602.  
  603.       Description  Renames a specified field.
  604.  
  605.       Syntax       AccessDDLRenameField(TableID, OldFieldName, NewFieldName)
  606.  
  607.       Remarks      The AccessDDLRenameField function uses the following
  608.                    arguments.
  609.  
  610.                    Argument       Description
  611.                    -------------- ------------------------------------------
  612.                    TableID        Long integer that identifies the table
  613.                                   that contains the field to be renamed;
  614.                                   this is the value returned by
  615.                                   AccessDDLOpenTable when the table was
  616.                                   opened.
  617.                    OldFieldName   String that is the name of an existing
  618.                                   field; may not exceed 64 characters.
  619.                    NewFieldName   String that is the new name; may not
  620.                                   exceed 64 characters.
  621.  
  622.                    Once renamed, all queries, forms, reports, or code that
  623.                    reference the old field name will be invalid.
  624.  
  625.                    If you rename a field that was created in table design
  626.                    (as opposed to created using MSADDL11.DLL), the field
  627.                    will lose all of its existing properties. You should
  628.                    then set the various properties in table design.
  629.  
  630.       Returns
  631.       ----------------------------------------------------------------------
  632.       ACCESSDDL_ErrSuccess             Operation was successful.
  633.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  634.                                        permissions.
  635.       ACCESSDDL_ErrFieldNotFound       Couldn't find the specified field.
  636.       ACCESSDDL_ErrFieldDuplicate      Field name already exists.
  637.       ACCESSDDL_ErrInvalidName         Invalid field name.
  638.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  639.                                        Null.
  640.       ACCESSDDL_ErrInvalidTableID      Invalid TableID argument.
  641.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  642.                                        called.
  643.  
  644. AccessDDLCreateIndex Function
  645.  
  646.       Description  Defines and creates an index in a specified table.
  647.  
  648.       Syntax       AccessDDLCreateIndex(TableID, IndexName, IndexFlag, Key)
  649.  
  650.       Remarks      The AccessDDLCreateIndex function uses the following
  651.                    arguments.
  652.  
  653.                    Argument       Description
  654.                    -------------- ------------------------------------------
  655.                    TableID        Long integer that identifies the table for
  656.                                   which a new index will be created; this is
  657.                                   the value returned by AccessDDLOpenTable
  658.                                   when the table was opened.
  659.                    IndexName      String that is the name of the index; may 
  660.                                   not exceed 64 characters.
  661.  
  662.                                   Primary Key
  663.                                   -----------
  664.                                   If you are defining the primary key (see
  665.                                   description for the IndexFlag argument,
  666.                                   below), the IndexName must be the string
  667.                                   "PrimaryKey".
  668.  
  669.                                   Single-Field Index
  670.                                   ------------------
  671.                                   The IndexName is the same as the name of
  672.                                   the field.
  673.  
  674.                                   Multiple-Field Index
  675.                                   --------------------
  676.                                   The IndexName is one of "Index1",
  677.                                   "Index2", and so on, through "Index5".
  678.                    IndexFlag      Long integer as follows:
  679.                                     ACCESSDDL_BitIndexPrimary
  680.                                       If this is to be the primary index.
  681.                                     ACCESSDDL_BitIndexUnique
  682.                                       If duplicate index entries are to be
  683.                                       disallowed.
  684.                    Key            String that is a list of field names, in
  685.                                   order of key significance, delimited with
  686.                                   an exclamation point ("!"); may not exceed
  687.                                   255 characters, nor contain more than 10
  688.                                   field names.
  689.  
  690.                    The current user must have both Modify Definitions and
  691.                    Read Data permissions for the table. 
  692.  
  693.                    The new index cannot include a Memo field, an OLE object
  694.                    field, or a Yes/No field.
  695.  
  696.                    Indexes exceeding the maximum length will be truncated.
  697.  
  698.       Returns
  699.       ----------------------------------------------------------------------
  700.       ACCESSDDL_ErrSuccess             Operation was successful.
  701.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  702.                                        permissions.
  703.       ACCESSDDL_ErrFieldCannotIndex    At least one of the specified fields
  704.                                        in Key is a Memo or OLE object field.
  705.       ACCESSDDL_ErrFieldNotFound       Couldn't find specified field name.
  706.       ACCESSDDL_ErrIndexDuplicate      Index already exists.
  707.       ACCESSDDL_ErrIndexHasPrimary     Primary index already exists.
  708.       ACCESSDDL_ErrInvalidName         Invalid index or field name.
  709.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  710.                                        Null.
  711.       ACCESSDDL_ErrInvalidTableID      Invalid TableID argument.
  712.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  713.                                        called.
  714.       ACCESSDDL_ErrTooManyKeys         Too many fields in Key.
  715.  
  716. AccessDDLDeleteIndex Function
  717.  
  718.       Description  Deletes a specified index.
  719.  
  720.       Syntax       AccessDDLDeleteIndex(TableID, IndexName)
  721.  
  722.       Remarks      The AccessDDLDeleteIndex function uses the following
  723.                    arguments.
  724.  
  725.                    Argument       Description
  726.                    -------------- ------------------------------------------
  727.                    TableID        Long integer that identifies the table
  728.                                   that contains the index to be deleted;
  729.                                   this is the value returned by
  730.                                   AccessDDLOpenTable when the table was
  731.                                   opened.
  732.                    IndexName      String that is the name of the index; may
  733.                                   not exceed 64 characters.
  734.  
  735.                    Once deleted, all code that references the deleted index
  736.                    will be invalid. You cannot delete an index if it is on
  737.                    the primary (referenced) side of a relationship.
  738.  
  739.                    The current user must have Modify Definitions permission
  740.                    for the table.
  741.  
  742.       Returns
  743.       ----------------------------------------------------------------------
  744.       ACCESSDDL_ErrSuccess             Operation was successful.
  745.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  746.                                        permissions.
  747.       ACCESSDDL_ErrIndexInUse          Specified index exists in a reference
  748.                                        (relationship) and can't be deleted.
  749.       ACCESSDDL_ErrIndexNotFound       Couldn't find specified index.
  750.       ACCESSDDL_ErrInvalidName         Invalid index name.
  751.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  752.                                        Null.
  753.       ACCESSDDL_ErrInvalidTableID      Invalid TableID argument.
  754.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  755.                                        called.
  756.  
  757. AccessDDLRenameIndex
  758.  
  759.       Description  Renames a specified index.
  760.  
  761.       Syntax       AccessDDLRenameIndex(TableID, Index, IndexNew)
  762.  
  763.       Remarks      The AccessDDLRenameIndex function uses the following
  764.                    arguments.
  765.  
  766.                    Argument       Description
  767.                    -------------- ------------------------------------------
  768.                    TableID        Long integer that identifies the
  769.                                   exclusively opened table; this is the
  770.                                   value returned by AccessDDLOpenTable when
  771.                                   the table was opened.
  772.                    OldIndexName   String that is the existing name of
  773.                                   the index; may not exceed 64 characters.
  774.                    NewIndexName   String that is the new index name; may not
  775.                                   exceed 64 characters.
  776.  
  777.                    Once you rename an index, all code that references the
  778.                    old index name will be invalid.
  779.  
  780.                    The current user must have Modify Definitions permission
  781.                    for the table.
  782.  
  783.       Returns
  784.       ----------------------------------------------------------------------
  785.       ACCESSDDL_ErrSuccess             Operation was successful.
  786.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  787.                                        permissions.
  788.       ACCESSDDL_ErrIndexDuplicate      Index already exists.
  789.       ACCESSDDL_ErrIndexNotFound       No such index.
  790.       ACCESSDDL_ErrInvalidName         Invalid index name specified.
  791.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  792.                                        Null.
  793.       ACCESSDDL_ErrInvalidTableID      Invalid TableID argument.
  794.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  795.                                        called.
  796.  
  797. AccessDDLCreateReference Function
  798.  
  799.       Description  Creates a relationship between two specified tables.
  800.                    Please note:  the referenced table is the primary table 
  801.                    (the "one" side of a one-to-many relationship or either
  802.                    table in a one-to-one relationship).  The referencing
  803.                    table is the related table (the "many" side of a one-to-
  804.                    many relationship).
  805.  
  806.       Syntax       AccessDDLCreateReference(TableID, ReferenceName, Fields, 
  807.                       ReferencedTable, ReferencedFields, MatchFlag)
  808.  
  809.       Remarks      The AccessDDLCreateReference function uses the following
  810.                    arguments.
  811.  
  812.                    Argument           Description
  813.                    ------------------ --------------------------------------
  814.                    TableID            Long integer that identifies the
  815.                                       referencing table; this is the value
  816.                                       returned by AccessDDLOpenTable when
  817.                                       the table was opened.
  818.                    ReferenceName      String that is the name of the
  819.                                       reference.
  820.                    Fields             String that is a list of field names
  821.                                       delimited with an exclamation point
  822.                                       ("!"); the data types of the
  823.                                       referencing fields must match those
  824.                                       of the referenced fields.
  825.                    ReferencedTable    String that is the name of the
  826.                                       referenced table; this table will be
  827.                                       opened exclusively to ensure that the
  828.                                       reference definition is seen by other
  829.                                       sessions; the referenced table may be
  830.                                       the same as the referencing table.
  831.                    ReferencedFields   A string that is a list of field
  832.                                       names delimited with an exclamation
  833.                                       point ("!"); if this argument is Null,
  834.                                       the fields that comprise the
  835.                                       referenced table's primary index are
  836.                                       used; if this argument is non-Null,
  837.                                       the fields must match the order of
  838.                                       the definition of an existing unique
  839.                                       index on the reference table with
  840.                                       attributes that are compatible with
  841.                                       the match type specified by the
  842.                                       MatchFlag argument; the correspondence
  843.                                       between referencing and referenced
  844.                                       fields is by position within the
  845.                                       field list (when specified) or
  846.                                       position within the primary index
  847.                                       definition (when not specified).
  848.                    MatchFlag          Long integer that specifies the match
  849.                                       type and referential triggered
  850.                                       actions; valid MatchFlag values are:
  851.  
  852.                                         ACCESSDDL_ReferenceUnique
  853.                                           Identifies the relationship as
  854.                                           one to one; if an index is
  855.                                           created, the index will have
  856.                                           the unique attribute.
  857.                                         ACCESSDDL_ReferenceDontEnforce
  858.                                           Allows users to define
  859.                                           relationships that are not
  860.                                           enforced.
  861.  
  862.                    You cannot create a relationship with the same
  863.                    referenced table, referenced fields, referencing table,
  864.                    and referencing fields.
  865.  
  866.                    If the referencing table already has a unique index on
  867.                    the referencing fields, then a unique reference is
  868.                    created, even if the MatchFlag argument is not set to
  869.                    ACCESSDDL_ReferenceUnique.
  870.  
  871.                    You cannot create a relationship on Memo or OLE object
  872.                    fields.
  873.  
  874.                    The current user must have Modify Definitions permission
  875.                    for both the referencing and referenced tables.
  876.  
  877.       Returns
  878.       ----------------------------------------------------------------------
  879.       ACCESSDDL_ErrSuccess             Operation was successful.
  880.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  881.                                        permissions.
  882.       ACCESSDDL_ErrFieldCannotIndex    At least one of the specified fields
  883.                                        is a Memo or OLE object field.
  884.       ACCESSDDL_ErrFieldNotFound       Couldn't find specified field name. 
  885.       ACCESSDDL_ErrIndexDuplicate      Specified reference already exists.
  886.       ACCESSDDL_ErrIndexNotFound       Foreign key doesn't match primary
  887.                                        key.
  888.       ACCESSDDL_ErrInvalidName         Invalid referenced table name.
  889.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  890.                                        Null.
  891.       ACCESSDDL_ErrInvalidParameter    Number of fields in foreign key
  892.                                        doesn't match number of fields in
  893.                                        primary key.
  894.       ACCESSDDL_ErrInvalidTableID      Invalid TableID argument.
  895.       ACCESSDDL_ErrLinkNotSupported    Can't create reference on attached
  896.                                        table.
  897.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  898.                                        called.
  899.       ACCESSDDL_ErrObjectNotFound      Table name can't be an empty string.
  900.       ACCESSDDL_ErrSelfReference       Can't refer to same field when the
  901.                                        referenced and reference tables are
  902.                                        the same.
  903.       ACCESSDDL_ErrTableInUse          Table is in use by another user.
  904.       ACCESSDDL_ErrTooManyKeys         Too many referenced fields specified
  905.                                        or too many fields specified in key.
  906.  
  907. AccessDDLDeleteReference Function
  908.  
  909.       Description  Deletes relationships between two specified tables.
  910.  
  911.       Syntax       AccessDDLDeleteReference(TableID, ReferenceName)
  912.  
  913.       Remarks      The AccessDDLDeleteReference function uses the following
  914.                    arguments.
  915.  
  916.                    Argument       Description
  917.                    -------------- ------------------------------------------
  918.                    TableID        Number that identifies the exclusively
  919.                                   open referencing table; this is the value
  920.                                   returned by AccessDDLOpenTable when the
  921.                                   table was opened.
  922.                    ReferenceName  String that is the name of the reference
  923.                                   you want to delete.
  924.  
  925.       Returns      
  926.       ----------------------------------------------------------------------
  927.       ACCESSDDL_ErrSuccess             Operation was successful.
  928.       ACCESSDDL_ErrAccessDenied        Current user doesn't have required
  929.                                        permissions.
  930.       ACCESSDDL_ErrIndexNotFound       Specified index couldn't be found.
  931.       ACCESSDDL_ErrInvalidParameter    One or more parameters is invalid or
  932.                                        Null.
  933.       ACCESSDDL_ErrNotInitialized      AccessDDLStartEngine hasn't been
  934.                                        called.
  935.  
  936. <end of file>
  937.